import { create } from 'zustand'
import { persist } from 'zustand/middleware'

export const usePluginStore = create(
  persist(
    set => ({
      pluginDetail: {},

      setPluginDetail: detail => {
        set(state => ({
          pluginDetail: detail
        }))
      }
    }),
    {
      name: 'plugin-storage', // name of item in the storage (must be unique)
      getStorage: () => localStorage // (optional) by default the 'localStorage' is used
    }
  )
)
